<template>
  <!--- 操作点检详情 -->
  <view v-if="listData.length > 0">
    <view class="grid-body mt-30" v-for="(item, index) in listData" :key="index">
      <view class="check grid-common">
        <view class="flex text"
          >内容分类：
          <text>{{ item.libraryName || '--' }}</text>
        </view>
        <view class="flex text"
          >数据录入：
          <text>{{ item.inputModeDesc || '--' }}</text>
        </view>
        <view class="flex"
          ><view class="text">巡检内容：</view>
          <text class="flex-1 text">{{ item.inspectionContent || '--' }}</text>
        </view>
        <view class="flex"
          ><view class="text">观测值：</view>
          <text class="flex-1 text">{{ item.observedValue || '--' }}</text>
        </view>
        <view class="flex"
          ><view class="text">照片：</view>
          <image-upload class="flex-1" state="view" :imageUrl="item.photos || ''"></image-upload>
        </view>
        <view class="flex"
          ><view class="text">结论：</view>
          <text class="flex-1 text">{{ item.conclusionDesc || '--' }}</text>
        </view>
      </view>
    </view>
  </view>
  <view v-else><empty></empty></view>
</template>

<script>
import Empty from '@/components/cu-empty/index.vue'
import ImageUpload from '@/components/image-upload/index.vue'
import { queryPositionDetail } from '@/api/equipment/Inspection-new'
export default {
  name: 'locationDetail',
  components: {
    Empty,
    ImageUpload
  },
  data() {
    return {
      subTaskPositionId: '', //部位id
      subTaskId: '', //子任务id
      positionName: '',
      listData: []
    }
  },
  mounted() {},
  onLoad({ subTaskPositionId, positionName }) {
    this.subTaskPositionId = subTaskPositionId
    this.positionName = positionName
    uni.setNavigationBarTitle({
      title: this.positionName
    })
    this.getDetail()
  },
  onPullDownRefresh() {
    this.getDetail()
  },
  beforeDestroy() {},
  methods: {
    async getDetail() {
      queryPositionDetail({
        subTaskPositionId: this.subTaskPositionId
      }).then((res) => {
        this.listData = res.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.form-task-content {
  margin-bottom: 107px;
}
.check {
  position: relative;

  .title {
    font-size: 34rpx;
    font-weight: 700;
  }

  .icon-style {
    width: 52rpx;
    height: 52rpx;
    margin-right: 20rpx;
  }

  .text {
    color: #999;
  }

  .flex-text {
    padding-top: 24rpx;
    display: flex;
    color: #999;

    text {
      color: #333;
      display: inline-block;
    }
  }

  .bor-top {
    padding-top: 20rpx;
    border-top: 1px solid #d5d7e3;
  }
}

.text-area {
  background: #f5f5f5;
  color: #333;
  border-radius: 10rpx;
  width: 100%;
  padding: 20rpx;
  height: 220rpx;
  font-size: 30rpx;
}

:deep(.uni-forms-item__label) {
  color: #999;
}
.submit-group {
  background: #fff;
  padding: 20px;
}
</style>
